home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / pxewin.zip / PXDIS.HPP < prev    next >
C/C++ Source or Header  |  1992-01-31  |  3KB  |  96 lines

  1. // PXEWIN - (C) Copyright 1992 by Beam Engineering, INC.
  2.  
  3. // PXDIS.HPP //
  4.  
  5. // Contents ----------------------------------------------------------------
  6. //
  7. //    This module contains the PDIS class for initializing the database
  8. //    table, record and fields.
  9. //
  10. // End ---------------------------------------------------------------------
  11.  
  12. // External Reference Name for this Header ---------------------------------
  13.  
  14. #ifndef PXDIS_HPP
  15.     #define PXDIS_HPP
  16.  
  17. // End ---------------------------------------------------------------------
  18.  
  19. // Interface Dependencies --------------------------------------------------
  20.  
  21. #ifndef PXEOBJ_CPP
  22.     #include "pxeobj.cpp"
  23. #endif // PXEOBJ_CPP //
  24.  
  25. #ifndef PXTBL_CPP
  26.     #include "pxtbl.cpp"
  27. #endif // PXTBL_CPP //
  28.  
  29. #ifndef PXEREC_CPP
  30.     #include "pxrec.cpp"
  31. #endif // PXREC_CPP //
  32.  
  33. #ifndef PXFIELD_CPP
  34.     #include "pxfield.cpp"
  35. #endif // PXFIELD_CPP //
  36.  
  37. // End ---------------------------------------------------------------------
  38.  
  39. // class PXDIS //
  40.  
  41. _CLASSDEF(PXDIS)
  42. class PXDIS:public PXEngObject
  43. {
  44. private:
  45.     virtual const Pchar streamableName()
  46.     const                    /* Defines the streamable
  47.                            name for this class. */
  48.     {
  49.         return "PXDIS";
  50.     }
  51. protected:
  52.     virtual Pvoid read(Ripstream);        /* Read persistant object */
  53.     virtual void write(Ropstream);        /* Write persistant object */
  54.     PXDIS(StreamableInit):            /* Persistant object
  55.                            constructor */
  56.         PXEngObject(streamableInit)
  57.     {
  58.  
  59.     }
  60. public:
  61.     PPXTbl my_table;            /* My table object */
  62.     PPXRec my_record;            /* My Record object */
  63.     PPPXField my_field;            /* Fields list */
  64.  
  65.     PXDIS();
  66.     static PTStreamable build();        /* Build persistant object */
  67.     int SetUp(int index,int mode,        /* Set up database */
  68.         int op,int display);
  69.     virtual ~PXDIS();            /* Destroy display */
  70.     char *Get(int i);            /* Get the data from the
  71.                            right field */
  72. };
  73.  
  74. // Description -------------------------------------------------------------
  75. //
  76. //    This class intializes a table for displaying purposes.  It was
  77. //    designed to use one record handle per table.  For the table is
  78. //    opened without an index.  All fields are initialized.
  79. //
  80. // End ---------------------------------------------------------------------
  81.  
  82. // Define inserters and extractors for persistant objects:
  83.  
  84. inline Ripstream operator >> (Ripstream is,RPXDIS cl)
  85.     {return is >> (RTStreamable)cl;}
  86.  
  87. inline Ripstream operator >> (Ripstream is,RPPXDIS cl)
  88.     {return is >> (RPvoid)cl;}
  89.  
  90. inline Ropstream operator << (Ropstream os,RPXDIS cl)
  91.     {return os << (RTStreamable)cl;}
  92.  
  93. inline Ropstream operator << (Ropstream os,PPXDIS cl)
  94.     {return os << (PTStreamable)cl;}
  95.  
  96. #endif // PXDIS_HPP //